#include "stdafx.h"
#include "wm_list.h"
#include "wm_list_ext.h"
#include "wm_engine32.h"


wm_ctl_list::wm_ctl_list(void)
{
}


wm_ctl_list::~wm_ctl_list(void)
{
	wm_hl_reg_free();
	
	CMenuWnd::DestroyMenu();

}

void wm_ctl_list::wm_hl_reg_init()
{
	CDuiString *pstr = 0;

	wm_hlight_reg[0] = new CStdPtrArray();
	pstr = new CDuiString((char*)"al");
	wm_hlight_reg[0]->Add(pstr);
	pstr = new CDuiString((char*)"ah");
	wm_hlight_reg[0]->Add(pstr);
	pstr = new CDuiString((char*)"ax");
	wm_hlight_reg[0]->Add(pstr);
	pstr = new CDuiString((char*)"eax");
	wm_hlight_reg[0]->Add(pstr);

	wm_hlight_reg[1] = new CStdPtrArray();
	pstr = new CDuiString((char*)"cl");
	wm_hlight_reg[1]->Add(pstr);
	pstr = new CDuiString((char*)"ch");
	wm_hlight_reg[1]->Add(pstr);
	pstr = new CDuiString((char*)"cx");
	wm_hlight_reg[1]->Add(pstr);
	pstr = new CDuiString((char*)"ecx");
	wm_hlight_reg[1]->Add(pstr);

	wm_hlight_reg[2] = new CStdPtrArray();
	pstr = new CDuiString((char*)"dl");
	wm_hlight_reg[2]->Add(pstr);
	pstr = new CDuiString((char*)"dh");
	wm_hlight_reg[2]->Add(pstr);
	pstr = new CDuiString((char*)"dx");
	wm_hlight_reg[2]->Add(pstr);
	pstr = new CDuiString((char*)"edx");
	wm_hlight_reg[2]->Add(pstr);

	wm_hlight_reg[3] = new CStdPtrArray();
	pstr = new CDuiString((char*)"bl");
	wm_hlight_reg[3]->Add(pstr);
	pstr = new CDuiString((char*)"bh");
	wm_hlight_reg[3]->Add(pstr);
	pstr = new CDuiString((char*)"bx");
	wm_hlight_reg[3]->Add(pstr);
	pstr = new CDuiString((char*)"ebx");
	wm_hlight_reg[3]->Add(pstr);

	wm_hlight_reg[4] = new CStdPtrArray();
	pstr = new CDuiString((char*)"sp");
	wm_hlight_reg[4]->Add(pstr);
	pstr = new CDuiString((char*)"esp");
	wm_hlight_reg[4]->Add(pstr);

	wm_hlight_reg[5] = new CStdPtrArray();
	pstr = new CDuiString((char*)"bp");
	wm_hlight_reg[5]->Add(pstr);
	pstr = new CDuiString((char*)"ebp");
	wm_hlight_reg[5]->Add(pstr);

	wm_hlight_reg[6] = new CStdPtrArray();
	pstr = new CDuiString((char*)"si");
	wm_hlight_reg[6]->Add(pstr);
	pstr = new CDuiString((char*)"esi");
	wm_hlight_reg[6]->Add(pstr);

	wm_hlight_reg[7] = new CStdPtrArray();
	pstr = new CDuiString((char*)"di");
	wm_hlight_reg[7]->Add(pstr);
	pstr = new CDuiString((char*)"edi");
	wm_hlight_reg[7]->Add(pstr);
}



void wm_ctl_list::wm_hl_reg_free()
{
	int n = 0;
	int m = 0;
	CDuiString *pstr = 0;

	for (n = 0; n < (sizeof(wm_hlight_reg) / sizeof(CStdPtrArray *)); n++)
	{
		if (wm_hlight_reg[n])
		{
			for (m = 0; m < wm_hlight_reg[n]->GetSize(); m++)
			{
				pstr = (CDuiString *)wm_hlight_reg[n]->GetAt(m);
				if (pstr)
				{
					delete pstr;
					pstr = 0;
				}
			}
			wm_hlight_reg[n] = 0;
		}
	}

	return;
}